DROP TABLE jms_dm.dm_lmdm_three_segment_monitoring_error_detail_dt;
CREATE EXTERNAL TABLE jms_dm.dm_lmdm_three_segment_monitoring_error_detail_dt(
 order_id   bigint  comment      '订单编号'
,input_time timestamp COMMENT '录入时间'
,waybill_no string    COMMENT '运单号'
,order_source_code string    COMMENT '订单来源编码'
,order_source_name string    COMMENT '订单来源名称'
,real_pick_name string COMMENT '取件网点'
,real_pick_code string COMMENT '取件网点code'
,receiver_province_id bigint COMMENT '收件省份id'
,receiver_province_desc string COMMENT '收件省份'
,receiver_city_id bigint COMMENT '收件城市id'
,receiver_city_desc  string COMMENT '收件城市'
,receiver_area_id bigint COMMENT '收件区县id'
,receiver_area_desc string COMMENT '收件区县'
,receiver_detailed_address   string COMMENT '收件人详细地址'
,dispatch_name  string COMMENT '预测派件网点'
,dispatch_code    string COMMENT '预测派件网点code'
,deliver_agent_name string COMMENT '派件网点代理区'
,deliver_agent_code string COMMENT '派件网点代理区code'
,deliver_name string COMMENT '派件网点'
,deliver_code string COMMENT '派件网点code'
,deliver_later_user  string COMMENT '派件员'
,deliver_later_user_code  string COMMENT '派件员code'
,is_abnormal int COMMENT '问题件标识'
,first_code string COMMENT '一段码'
,second_code string COMMENT '二段码'
,third_code string COMMENT '三段码'
,sign_later_scantime timestamp COMMENT '签收时间'
,first_code_fail int COMMENT '一段码解析失败'
,first_code_error int COMMENT '一段码解析异常'
,second_code_fail int COMMENT '二段码解析失败'
,second_code_error int COMMENT '二段码解析异常'
,third_code_fail int COMMENT '三段码解析失败'
,third_code_error int COMMENT '三段码解析异常'
,sign_later_scantime_dt timestamp COMMENT '签收时间(f)'
,sign_later_scansitecode   string COMMENT '签收网点code'
,sign_later_scansite  string COMMENT '签收网点'
,sj_first_code string COMMENT '实际一段码'
,sj_second_code string COMMENT '实际二段码'
,sj_third_code string COMMENT '实际三段码'
 )
COMMENT '三段码解析监控明细表-错误数据'
PARTITIONED BY (dt string COMMENT '入仓时间')
STORED AS PARQUET
LOCATION '/dw/hive/jms_dm.db/external/dm_lmdm_three_segment_monitoring_error_detail_dt'
TBLPROPERTIES (
          'discover.partitions' = 'false',
          'parquet.column.index.access' = 'true'
          );